package com.hospital.register.vo.core.common;

import com.alibaba.fastjson.JSONObject;
import com.hospital.register.model.core.BookingRule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

@Data
@ToString
@ApiModel(description = "医院查询结果")
public class HospitalQueryVo implements Serializable{

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "医院编号")
    private String hoscode;

    @ApiModelProperty(value = "医院名称")
    private String hosname;

    @ApiModelProperty(value = "医院类型")
    private String hostype;

    @ApiModelProperty(value = "省code")
    private String provinceCode;

    @ApiModelProperty(value = "市code")
    private String cityCode;

    @ApiModelProperty(value = "区code")
    private String districtCode;

    @ApiModelProperty(value = "详情地址")
    private String address;

    @ApiModelProperty(value = "医院logo")
    private String logoData;

    @ApiModelProperty(value = "医院简介")
    private String intro;

    @ApiModelProperty(value = "坐车路线")
    private String route;

    @ApiModelProperty(value = "状态 0：未上线 1：已上线")
    private Byte status;

    @ApiModelProperty(value = "预约规则")
    private BookingRule bookingRule;

    @ApiModelProperty(value = "其他参数")
    private Param param;

    public void setBookingRule(String bookingRule) {
        this.bookingRule = JSONObject.parseObject(bookingRule, BookingRule.class);
    }

    @ApiModel(value = "其它参数")
    @Data
    @ToString
    public static class Param implements Serializable {

        @ApiModelProperty(value = "省、市、区")
        private String fullAddress;

        @ApiModelProperty(value = "医院类型")
        private String hostypeString;

    }

}

